package com.example.safeassistan.home.adapter;

import android.widget.TextView;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.safeassistan.R;
import com.example.safeassistan.home.model.BackLogFragmentModel;
import com.example.safeassistan.risk.model.RiskPointtableModel;

import java.util.List;

public class InvestigationTab1Adapter extends BaseQuickAdapter<RiskPointtableModel.ResultDTO.DangerVOListDTO ,BaseViewHolder> {
    public InvestigationTab1Adapter(@Nullable List<RiskPointtableModel.ResultDTO.DangerVOListDTO > data) {
        super(R.layout.tab_item1, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, RiskPointtableModel.ResultDTO.DangerVOListDTO  item) {
        TextView tv=helper.getView(R.id.tv);
        tv.setText(item.getDangerSrcName());

        if (item.getSelect()==null){
            if (helper.getPosition()==0){
                item.setSelect(true);
            }else {
                item.setSelect(false);
            }
        }


        if (item.getSelect()){
            tv.setTextColor(mContext.getResources().getColor(R.color.blue_3B5BEA));
        }else {
            tv.setTextColor(mContext.getResources().getColor(R.color.gray3));
        }
    }
}